/* *************************************************************************** */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_ARGUMENT_SIZE 8

struct flagList_t
{
  int option;
  char *file;
} flagList;

int main(int argc, char ** argv)
{
  int i;

  if (argc != 3) {
    fprintf(stderr, "usage: %s [OPTIONS]... [FILE]\n\tuse -h for help\n", argv[0]);
    exit(EXIT_FAILURE);
  }

  for (i = 0; i < argc; i++)
    if (argv[i][0] != '-')
      flagList.file = argv[i];
    else
      if (!strncmp(argv[i], "-eyes", MAX_ARGUMENT_SIZE))
        flagList.option = 1;
      else if (!strncmp(argv[i], "-p", MAX_ARGUMENT_SIZE))
        flagList.option = 2;
      else if (!strncmp(argv[i], "-pi", MAX_ARGUMENT_SIZE))
        flagList.option = 3;
      else if (!strncmp(argv[i], "-h", MAX_ARGUMENT_SIZE))
        flagList.option = 0;
      else
        flagList.option = -1;

  switch (flagList.option)
  {
    case 0:
      printf("supported commands:\n  -eyes\toption 1\n  -p\toption 2\n  -pi\toption 3\n  -h\t display this help message\n");
      break;
    case 1:
      printf("-eyes switch enabled\n");
      break;
    case 2:
      printf("-p switch enabled\n");
      break;
    case 3:
      printf("-pi switch enabled\n");
      break;
    default:
      fprintf(stderr, "unrecognized arguments supplied, using -h for help message\n");
      break;
  }

#ifdef DEBUG
printf("#DEBUG_MESSAGE#\nfile: %s\n", flagList.file);
printf("opt: %d\n#END_DEBUG_MESSAGE#\n", flagList.option);
#endif

  return EXIT_SUCCESS;
}
